define(['core/boilerplate', "core/manager", "menu"], function(Boilerplate, Manager, Menu) {
	var MenuManager = new Manager(Menu);

	MenuManager._init = MenuManager.init;

	MenuManager.init = function(Mode) {
		todo('Définir le mode de rendu CANVAS pour les menus');

		this.displayMode = Mode === 'CANVAS' ? Mode : 'HTML';
		this._init(0);

		switch (this.displayMode) {
			case 'HTML' :

				// Create Menu Container
				this.container = document.createElement('div');

				// Configure it
				this.container.id = 'menu_container';
				this.container.style.width = Boilerplate.scene.width+'px';
				this.container.style.height = Boilerplate.scene.height+'px';

				// Add it to page
				var body = document.getElementsByTagName("body")[0];
				body.appendChild(this.container);

			break;

			case 'CANVAS' : 
			break;

			default : 
		}

		this.addMenu('Main');
		this.addMenu('Settings');
		this.switchToMenu('main_menu');
	}

	MenuManager.addMenu = function(Name) {
		this.entities.push(this.create(Name));
	}

	MenuManager.switchToMenu = function(ID) {
		log(ID);
		switch (this.displayMode) {
			case 'HTML' :
				addClass($('.menu_screen'), 'hide');
				removeClass($('#'+ID+'_0'), 'hide');
			break;

			case 'CANVAS' : 
			break;

			default : 
		}
	}

	MenuManager.functions = {
		SwitchToMenu : function() { var id = this.getAttribute('data-identifier'); MenuManager.switchToMenu(id); }
	};

	return MenuManager;
});